package com.sq.partner.manager.dao;

import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.DictAddrDto;
import com.sq.partner.manager.mybatis.model.DictDto;
import com.sq.partner.manager.mybatis.model.GatewayChannelInfo;
import com.sq.partner.manager.mybatis.model.GatewayChannelTranstype;
import com.sq.partner.manager.mybatis.model.GatewaySubChannel;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.TreeDto;
import com.sq.partner.manager.util.Page;


/**
 * 
 * @author duguangwei
 *
 */
public interface  IGatewayChannelInfoConfigDao  extends BaseDao{

	/**
	 * 根据appid查询有效的channelInfo
	 * @param gatewayChannelInfo
	 * @return
	 * @throws Exception
	 */
	public List<GatewayChannelInfo> getValidListByAppid(GatewayChannelInfo channelInfo)throws Exception;
	
	public List<GatewayChannelInfo> getListByDept( GatewayChannelInfo gatewayChannelInfo) throws Exception;
	public Page<GatewayChannelInfo> getListByDept(Page<GatewayChannelInfo> page) throws Exception;
	/**方案新增合作伙伴列表*/
	public Page<GatewayChannelInfo> getListPlanByDept(Page<GatewayChannelInfo> page) throws Exception;

	public Integer getCount(GatewayChannelInfo gatewayChannelInfo)throws Exception;
	public List<GatewayChannelTranstype> loadTransNameByApplication(GatewayChannelTranstype gatewayChannelInfo) throws Exception;
	public List<GatewayChannelTranstype> loadTransNameByApplication1(GatewayChannelTranstype gatewayChannelInfo) throws Exception;

	public List<GatewayChannelInfo> getList(int start, int pageSize,GatewayChannelInfo gatewayChannelInfo)throws Exception;

	public List<GatewayChannelTranstype> getTranstypeBychannelCode(GatewayChannelTranstype gatewayChannelInfo)throws Exception;
	/**
	 * 分页条件查询ChannelInfo
	 * @param pageIndex
	 * @param channelInfo
	 * @return
	 * @throws Exception 
	 */
	public Page queryByCriteria(Integer pageIndex,GatewayChannelInfo channelInfo,GatewayUser user) throws Exception;
	
	/**
	 * 根据channelCode删除相应ChannelInfo
	 * @param channelInfo
	 */
	public void deleteByChannelCode(String channelCode) throws Exception;
	
	/**
	 * 更改ChannelInfo的fkAppId
	 * @param channelInfo
	 */
	public void updateChannelAppId(GatewayChannelInfo channelInfo) throws Exception;
	
	/**
	 * 添加channelInfo
	 * @param channelInfo
	 * @throws Exception
	 */
	public void save(GatewayChannelInfo channelInfo) throws Exception;
	
	/**
	 * 更新channelInfo
	 * @param channelInfo
	 * @throws Exception
	 */
	public void update(GatewayChannelInfo channelInfo) throws Exception;
	
	/**
	 * 根据channelInfo属性查询相应的channelInfo
	 * @param channelInfo
	 * @return
	 * @throws Exception
	 */
	public GatewayChannelInfo queryByChannelInfo(GatewayChannelInfo channelInfo) throws Exception;
	
	
	/**
	 * 根据ChannelCodeStr获取界面出单的GatewayChannelInfo列表
	 * @param ChannelCodeStr
	 * @return
	 * @throws Exception
	 */
	public List<GatewayChannelInfo> queryChannelsByChannelCodeStr(String ChannelCodeStr) throws Exception;
	
	/**
	 * 根据channelInfo属性查询相应的channelInfoList
	 * @param channelInfo
	 * @return
	 * @throws Exception
	 */
	public List<GatewayChannelInfo> queryListByChannelInfo(GatewayChannelInfo channelInfo) throws Exception;
	/**
	 * 分页查询没有“creditLmtDef”的合作伙伴及其子机构
	 * @return
	 * @throws Exception
	 */
	public Page<Map> queryNotInCreditLmtDefChannelInfo(Page<Map> page) throws Exception;
	
	public GatewayChannelInfo queryChannelInfoBychannelCode(String channelCode) throws Exception;
	//查询省市县三级联动接口
	public List<DictAddrDto> queryProvinceCityCounty(DictAddrDto dictAddr) throws Exception;
	//查询企业类型和行业类型二级联动接口
	public List<DictDto> querySubElementList(DictDto dict) throws Exception;

	//查询当前用户角色配置的机构下的合作伙伴列表
	public Page<GatewaySubChannel> queryChannelListByDeptForTree(GatewayUser user,Page<GatewaySubChannel> page) throws Exception;	
	
	public Page queryAppInfoByChannelCode(Integer pageIndex,String channelCode) throws Exception;

	public Page<GatewayChannelInfo> getChannelInfoListByDeptCode(Page<GatewayChannelInfo> page)throws Exception;
	
	public Page<GatewayChannelInfo> queryChannelInfoPageOfLife(Page<GatewayChannelInfo> page)throws Exception;
	
	public List<Map> queryChannelInfoList(GatewayChannelInfo channelInfo,String flag)throws Exception;

	//查询当前用户权限合作伙伴树
	public List<TreeDto> queryChannelInfoListsForTree(String deptCode) throws Exception;
	
	public List<TreeDto> querySubChannelTreeByParentChannelCode(String parentChannelCode) throws Exception;
	
	/**导出方案代理信息查询*/
	public  List<Map<String, Object>> impNlifeInfo(Map<String, Object>map) throws Exception;
	/**修改表中的一些回调地址信息*/
	public void updateToURL(GatewayChannelInfo channelInfo) throws Exception;

	public Page<Map<String, Object>> queryByCriteria1(Integer pageIndex,Integer size,GatewayChannelInfo channelInfo,GatewayUser user,String businessChannelType) throws Exception;

	Page<GatewayChannelInfo> queryChannelInfoPageOfFacadeNlife(Page<GatewayChannelInfo> page) throws Exception;

	/**查询意健险方案是否为互联网业务方案*/
	String queryIfInternetPlan(String partnerCode) throws Exception;
}
